Repository navigation
fix(finai): clean abandoned uploads and harden imports - #291
NeerajCodz wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8f0fac362
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| } else if (char === '"' && fieldStart) quoted = true; | ||
| else if (char === '\n' || char === '\r') { | ||
| for (const delimiter of candidates) records.get(delimiter)!.push(counts.get(delimiter)! + 1); |
There was a problem hiding this comment.
Bound delimiter detection before collecting every row
For newline-heavy CSV attachments, this loop stores four numbers per physical line and scans the entire file before the parser's 5,000-row limit is applied. Since uploads may be 10 MB, a file containing millions of short lines can allocate tens of millions of array entries and exhaust the Convex action's memory instead of being safely truncated; sample only a bounded number of records or aggregate the width frequencies online.
Useful? React with 👍 / 👎.
| !upload || | ||
| upload.userId !== user._id || | ||
| upload.storageId !== undefined || | ||
| now - upload.createdAt > finaiAttachmentLimits.registerWindowMs || |
There was a problem hiding this comment.
Start the registration window when the upload finishes
On a slow connection, a valid attachment is rejected once 15 minutes have elapsed since the upload URL was requested, even if the object only just reached storage. A 10 MB upload can exceed that interval on a constrained mobile network, and this check now uses the ticket creation time rather than the stored file's _creationTime, contrary to the registration window's intended post-upload grace period.
Useful? React with 👍 / 👎.
| status: claimed.kind === 'transaction.import' ? 'running' : 'failed', | ||
| errorCode, |
There was a problem hiding this comment.
Stop showing failed imports as still running
When an import fails with a known error—such as a deleted account/category or an invalid row—the action has already returned { status: 'failed' }, but this patch persists it as running. actionViews therefore renders the card as “Saving…” until staleRunningMs elapses and then makes it retryable without cancellation; permanent failures repeat this cycle indefinitely instead of displaying the stored error as a terminal failure. Reserve the stale-running retry path for genuinely interrupted executions or introduce an explicit retryable failure state.
Useful? React with 👍 / 👎.
- Load workbook date styles before parsing worksheets. - Report omitted sheets without materializing every worksheet declaration.
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- Create server-issued tickets before storing fixture files. - Import spreadsheet parsing helpers in their consumer tests.
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Changes
Issues
Fixes #256
Fixes #257
Fixes #258
Fixes #259
Fixes #260
Fixes #261
Fixes #262
Fixes #263